<?php

class User extends CI_Controller
{

    private static $layout_data = array();
    private static $home_data = array();

    function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        
    }

    /**
     * Login function
     */
    public function login()
    {
        $username = $this->input->post('username');
        $password = $this->input->post('password');

        if ($username == 'oneway' AND $password == '123456')
        {
            $this->session->set_userdata('is_login', 1);
        }

        redirect($_SERVER['HTTP_REFERER']);
    }

    /**
     * Logout function
     */
    public function logout()
    {
        @$this->session->unset_userdata('is_login');

        redirect($_SERVER['HTTP_REFERER']);
    }

}